/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MainScreen.java
 *
 * Created on 22/05/2012, 20:06:43
 */
package views;

import javax.swing.table.DefaultTableModel;

/**
 *
 * @author 40800431
 */
public class MainScreen extends javax.swing.JPanel {

    /** Creates new form MainScreen */
    public MainScreen(MainWindow parentFrame) {
        initComponents();
        
        this.parentFrame = parentFrame;
        
        Object myProjectData[][] = {{"Teste", "10/07/2012"}};
         
        this.tblProjects.setModel(
                new DefaultTableModel(myProjectData, new String [] {"Nome", "Data de término"}) {
                Class[] types = new Class[] {String.class,String.class}; 
                boolean[] canEdit = new boolean[] {true, true};
                public Class getColumnClass(int columnIndex){ return types [columnIndex];}
                public boolean isCellEditable(int rowIndex, int columnIndex){ return canEdit [columnIndex];}
            });
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        tblProjects = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex) {
                return false;   //Disallow the editing of any cell
            }
        };
        lblTitleMeusProjetos = new javax.swing.JLabel();
        lblTitleMeusProjetos1 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tblProjects1 = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int colIndex) {
                return false;   //Disallow the editing of any cell
            }
        };
        btnVisualizarProjeto = new javax.swing.JButton();
        btnVisualizarTarefa = new javax.swing.JButton();

        jScrollPane1.setViewportView(tblProjects);

        lblTitleMeusProjetos.setFont(new java.awt.Font("Ubuntu", 0, 24)); // NOI18N
        lblTitleMeusProjetos.setText("Meus Projetos");

        lblTitleMeusProjetos1.setFont(new java.awt.Font("Ubuntu", 0, 18)); // NOI18N
        lblTitleMeusProjetos1.setText("Minhas Tarefas");

        jScrollPane2.setViewportView(tblProjects1);

        btnVisualizarProjeto.setText("Visualizar");
        btnVisualizarProjeto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVisualizarProjetoActionPerformed(evt);
            }
        });

        btnVisualizarTarefa.setText("Visualizar");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 591, Short.MAX_VALUE)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 591, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblTitleMeusProjetos)
                            .addComponent(lblTitleMeusProjetos1)
                            .addComponent(btnVisualizarProjeto, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnVisualizarTarefa, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lblTitleMeusProjetos)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnVisualizarProjeto)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblTitleMeusProjetos1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 189, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnVisualizarTarefa)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void btnVisualizarProjetoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVisualizarProjetoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_btnVisualizarProjetoActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnVisualizarProjeto;
    private javax.swing.JButton btnVisualizarTarefa;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JLabel lblTitleMeusProjetos;
    private javax.swing.JLabel lblTitleMeusProjetos1;
    private javax.swing.JTable tblProjects;
    private javax.swing.JTable tblProjects1;
    // End of variables declaration//GEN-END:variables
    private MainWindow parentFrame;
}
